package com.ymatou.iapi.trading.sellerquery2.testcase;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.commons.collections.CollectionUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.settlement.service.SettlementService;
import com.ymatou.iapi.trading.operate.parameter.Order;
import com.ymatou.iapi.trading.operate.parameter.OrderInfoPo;
import com.ymatou.iapi.trading.operate.parameter.PlaceOrderResp;
import com.ymatou.iapi.trading.operate.parameter.PlaceOrderService;
import com.ymatou.iapi.trading.operate.parameter.po.OrderInfoSubPo;
import com.ymatou.iapi.trading.operate.parameter.req.ApplySalesRefundRequestBean;
import com.ymatou.iapi.trading.ordersync.service.SyncVerifyService;
import com.ymatou.iapi.trading.sellerquery2.parameter.vo.SubProductInfo;
import com.ymatou.query.seller.trading.api.parameter.GetSingleOrderInfoBean;
import com.ymatou.query.seller.trading.api.parameter.GetSingleOrderInfoResponse;
import com.ymatou.query.seller.trading.api.parameter.OrderEntities;
import com.ymatou.query.seller.trading.api.parameter.Sp_GetSingleOrderInfo_1;
import com.ymatou.query.seller.trading.api.parameter.Ymt_O_OrderNote;
import com.ymatou.query.seller.trading.api.parameter.Ymt_Order;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderInfo;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderState;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderSummary;
import com.ymatou.query.seller.trading.api.service.OrderCreate;
import com.ymatou.query.trading.api.parameter.OrderConverter;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P3;
import com.ymttest.business.service.OrderCallService;
import com.ymttest.common.entitie.C2COrderInfo.C2COrderInfoExt;
import com.ymttest.common.entitie.OrderItemInfo;
import com.ymttest.common.entitie.OrderItemInfoExt;
import com.ymttest.common.order.sellerquery2.Common;
import com.ymttest.database.model.ProductPromotion;
import com.ymttest.database.model.Ymt_Bill;
import com.ymttest.database.model.Ymt_CreditDetail;
import com.ymttest.database.model.Ymt_OrderExt;
import com.ymttest.database.model.Ymt_OrderPostPay;
import com.ymttest.database.model.Ymt_OrderToBill;
import com.ymttest.database.model.Ymt_Order_Frozen;
import com.ymttest.database.model.Ymt_TradingItem;
import com.ymttest.database.sqlwapper.DefaultWapper;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.constant.ECode;

/**
 * 获取单个订单信息 FreeMaker Template自动生成代码
 */
@TestSuite
@SuppressWarnings("rawtypes")
public class Ts_GetSingleOrderInfo {
	private static GetSingleOrderInfoBean gsoibean;
	private static com.ymatou.iapi.trading.sellerquery2.service.GetSingleOrderInfoCall gsoicall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取单个订单信息");
	}

	@Before
	public void caseUp() {
		gsoibean = new GetSingleOrderInfoBean();
		//		gsoicall = new com.ymatou.query.seller.trading.api.service.GetSingleOrderInfoCall();
		gsoicall = new com.ymatou.iapi.trading.sellerquery2.service.GetSingleOrderInfoCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(gsoicall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	private void verify() {
		GetSingleOrderInfoResponse expectedResponse = new GetSingleOrderInfoResponse();
		ConstructExpectedResponse(expectedResponse);

		GetSingleOrderInfoResponse actualResponse = gsoicall
				.getSingleOrderInfoResponse();

		com.ymatou.query.seller.trading.api.parameter.OrderInfo expect = expectedResponse
				.getOrderInfo();
		com.ymatou.query.seller.trading.api.parameter.OrderInfo actual = actualResponse
				.getOrderInfo();
		if (expect == null) {
			DataUtil.verify(expect, actual, "验证OrderInfo == null");
		} else {
			boolean notnull = actual != null;
			DataUtil.verify(true, notnull, "验证OrderInfo != null");
			if (notnull) {
				DataUtil.verify(expect.getTotalRefundThirdPartyDiscount(),
						actual.getTotalRefundThirdPartyDiscount(),
						"验证OrderInfo.TotalRefundThirdPartyDiscount");

				DataUtil.verify(expect.getIsFirstOrder(),
						actual.getIsFirstOrder(), "验证OrderInfo.IsFirstOrder");
				DataUtil.verify(expect.isPreSaleOrder(),
						actual.isPreSaleOrder(), "验证OrderInfo.PreSaleOrder");
				DataUtil.verify(expect.getDiscountOfThirdParty(),
						actual.getDiscountOfThirdParty(),
						"验证OrderInfo.DiscountOfThirdParty");
				DataUtil.verifyDateEquals(expect.getAcceptTime(),
						actual.getAcceptTime(), "验证OrderInfo.AcceptTime");
				DataUtil.verify(expect.getAddress(), actual.getAddress(),
						"验证OrderInfo.Address");
				DataUtil.verifyDateEquals(expect.getAddTime(),
						actual.getAddTime(), "验证OrderInfo.AddTime");
				DataUtil.verifyDateEquals(expect.getApplyPostPayTime(),
						actual.getApplyPostPayTime(),
						"验证OrderInfo.ApplyPostPayTime");
				DataUtil.verify(expect.getAutoCancelOrderHours(),
						actual.getAutoCancelOrderHours(),
						"验证OrderInfo.AutoCancelOrderHours");

				DataUtil.verify(expect.getBillInfoList(),
						actual.getBillInfoList(), "验证OrderInfo.BillInfoList");
				DataUtil.verify(expect.getBuyerId(), actual.getBuyerId(),
						"验证OrderInfo.BuyerId");
				//				DataUtil.verify(expect.getBuyerLoginEmail(), actual.getBuyerLoginEmail(), "验证OrderInfo.BuyerLoginEmail");
				DataUtil.verify(expect.getBuyerLoginId(),
						actual.getBuyerLoginId(), "验证OrderInfo.BuyerLoginId");
				DataUtil.verify(expect.getBuyerNickName(),
						actual.getBuyerNickName(), "验证OrderInfo.BuyerNickName");
				DataUtil.verifyDateEquals(expect.getCancelTime(),
						actual.getCancelTime(), "验证OrderInfo.CancelTime");
				DataUtil.verifyDateEquals(expect.getChangeAddressTime(),
						actual.getChangeAddressTime(),
						"验证OrderInfo.ChangeAddressTime");
				DataUtil.verifyDateEquals(expect.getConfirmedTime(),
						actual.getConfirmedTime(), "验证OrderInfo.ConfirmedTime");
				DataUtil.verify(expect.getCouponCode(), actual.getCouponCode(),
						"验证OrderInfo.CouponCode");
				//				DataUtil.verify(expect.getCouponType(), actual.getCouponType(), "验证OrderInfo.CouponType");
				DataUtil.verify(expect.getCouponValue(),
						actual.getCouponValue(), "验证OrderInfo.CouponValue");
				DataUtil.verifyDateEquals(expect.getCreditAddTime(),
						actual.getCreditAddTime(), "验证OrderInfo.CreditAddTime");
				DataUtil.verify(expect.getCreditDescript(),
						actual.getCreditDescript(),
						"验证OrderInfo.CreditDescript");
				DataUtil.verify(expect.isCredited(), actual.isCredited(),
						"验证OrderInfo.Credited");
				DataUtil.verify(expect.getCreditId(), actual.getCreditId(),
						"验证OrderInfo.CreditId");
				DataUtil.verify(expect.getCreditScoreRange(),
						actual.getCreditScoreRange(),
						"验证OrderInfo.CreditScoreRange");
				DataUtil.verify(expect.getCreditSellerReply(),
						actual.getCreditSellerReply(),
						"验证OrderInfo.CreditSellerReply");
				DataUtil.verifyDateEquals(
						expect.getCreditSellerReplyUpdateTime(),
						actual.getCreditSellerReplyUpdateTime(),
						"验证OrderInfo.CreditSellerReplyUpdateTime");
				DataUtil.verify(expect.getCreditServiceRange(),
						actual.getCreditServiceRange(),
						"验证OrderInfo.CreditServiceRange");
				DataUtil.verify(expect.getCreditUniformityRange(),
						actual.getCreditUniformityRange(),
						"验证OrderInfo.CreditUniformityRange");
				DataUtil.verifyDateEquals(expect.getCreditUpdateTime(),
						actual.getCreditUpdateTime(),
						"验证OrderInfo.CreditUpdateTime");
				DataUtil.verify(expect.getCreditUserId(),
						actual.getCreditUserId(), "验证OrderInfo.CreditUserId");

				DataUtil.verify(expect.isDelayReceiveFrozened(),
						actual.isDelayReceiveFrozened(),
						"验证OrderInfo.DelayReceiveFrozened");
				DataUtil.verifyDateEquals(expect.getDelayReceiveFrozenTime(),
						actual.getDelayReceiveFrozenTime(),
						"验证OrderInfo.DelayReceiveFrozenTime");
				DataUtil.verifyDateEquals(expect.getDelayReceiveUpdateTime(),
						actual.getDelayReceiveUpdateTime(),
						"验证OrderInfo.DelayReceiveUpdateTime");
				DataUtil.verify(expect.getDelayReceiveUserId(),
						actual.getDelayReceiveUserId(),
						"验证OrderInfo.DelayReceiveUserId");
				DataUtil.verify(expect.getDiscount(), actual.getDiscount(),
						"验证OrderInfo.Discount");
				DataUtil.verifyDateEquals(expect.getDiscountTime(),
						actual.getDiscountTime(), "验证OrderInfo.DiscountTime");
				DataUtil.verifyDateEquals(expect.getDispatchTime(),
						actual.getDispatchTime(), "验证OrderInfo.DispatchTime");
				DataUtil.verifyDateEquals(expect.getDispathTime(),
						actual.getDispathTime(), "验证OrderInfo.DispathTime");
				//				DataUtil.verify(expect.getDistributor(), actual.getDistributor(), "验证OrderInfo.Distributor");
				DataUtil.verify(expect.getEmail(), actual.getEmail(),
						"验证OrderInfo.Email");
				DataUtil.verify(expect.getFirstPay(), actual.getFirstPay(),
						"验证OrderInfo.FirstPay");
				DataUtil.verify(expect.getFreight(), actual.getFreight(),
						"验证OrderInfo.Freight");
				DataUtil.verify(expect.isFrozen(), actual.isFrozen(),
						"验证OrderInfo.Frozen");
				DataUtil.verify(expect.isIsAutoReceiveEnabled(),
						actual.isIsAutoReceiveEnabled(),
						"验证OrderInfo.IsAutoReceiveEnabled");
				DataUtil.verify(expect.getIsMerchant(), actual.getIsMerchant(),
						"验证OrderInfo.IsMerchant");
				DataUtil.verify(expect.isIsShippedByXlobo(),
						actual.isIsShippedByXlobo(),
						"验证OrderInfo.IsShippedByXlobo");
				DataUtil.verify(expect.getLeaveWord(), actual.getLeaveWord(),
						"验证OrderInfo.LeaveWord");
				DataUtil.verify(expect.getLogisticsType(),
						actual.getLogisticsType(), "验证OrderInfo.LogisticsType");
				DataUtil.verify(expect.getNeedPostPay(),
						actual.getNeedPostPay(), "验证OrderInfo.NeedPostPay");
				DataUtil.verify(expect.getNeedPrePayAmountOfCash(),
						actual.getNeedPrePayAmountOfCash(),
						"验证OrderInfo.NeedPrePayAmountOfCash");
				DataUtil.verify(expect.getOldDiscount(),
						actual.getOldDiscount(), "验证OrderInfo.OldDiscount");
				DataUtil.verify(expect.getOldFreight(), actual.getOldFreight(),
						"验证OrderInfo.OldFreight");
				DataUtil.verify(DataUtil.Integerr.GetValueOrDefault(expect
						.getOperate()), DataUtil.Integerr
						.GetValueOrDefault(actual.getOperate()),
						"验证OrderInfo.Operate");
				//				DataUtil.verifyDateEquals(expect.getOperateExpireTime(), actual.getOperateExpireTime(),
				//								"验证OrderInfo.OperateExpireTime");
				DataUtil.verify(expect.getOrderDiscount(),
						actual.getOrderDiscount(), "验证OrderInfo.OrderDiscount");
				DataUtil.verify(expect.getOrderId(), actual.getOrderId(),
						"验证OrderInfo.OrderId");
				if (expect.getOrderItemList() == null) {
					DataUtil.verify(expect.getOrderItemList(),
							actual.getOrderItemList(),
							"验证OrderInfo.OrderItemList=null");
				} else {
					if (!DataUtil.isNullOrEmpty(expect.getOrderItemList())) {
						DataUtil.verify(expect.getOrderItemList().size(),
								actual.getOrderItemList().size(),
								"验证OrderInfo.OrderItemList.size()");
						boolean equal = expect.getOrderItemList().size() == actual
								.getOrderItemList().size();
						if (equal) {
							for (OrderItemInfo exp : expect.getOrderItemList()) {
								String expPid = exp.getProductId();
								boolean exists = actual
										.getOrderItemList()
										.stream()
										.anyMatch(
												x -> x.getProductId().equals(
														expPid));
								DataUtil.verify(
										true,
										exists,
										"验证ProductId=["
												+ expPid
												+ "]是否存在于OrderInfo.OrderItemList.size()");
								if (exists) {
									OrderItemInfo act = actual
											.getOrderItemList()
											.stream()
											.filter(x -> x.getProductId()
													.equals(expPid))
											.collect(Collectors.toList())
											.get(0);
									verifyOrderItemList(exp, act, expPid);

									verifySubProducts(expect.getOrderId(), act);

								}
							}
						}
					}
				}
				DataUtil.verify(expect.getOrderPrice(), actual.getOrderPrice(),
						"验证OrderInfo.OrderPrice");
				DataUtil.verify(expect.isPaidInFull(), actual.isPaidInFull(),
						"验证OrderInfo.PaidInFull");
				DataUtil.verifyDateEquals(expect.getPaidTime(),
						actual.getPaidTime(), "验证OrderInfo.PaidTime");
				DataUtil.verify(expect.getPhone(), actual.getPhone(),
						"验证OrderInfo.Phone");
				DataUtil.verify(expect.getPlatformEnum(),
						actual.getPlatformEnum(), "验证OrderInfo.PlatformEnum");
				DataUtil.verify(expect.getPostCode(), actual.getPostCode(),
						"验证OrderInfo.PostCode");
				DataUtil.verify(expect.getPostPaidAmountOfCoupon(),
						actual.getPostPaidAmountOfCoupon(),
						"验证OrderInfo.PostPaidAmountOfCoupon");
				DataUtil.verify(expect.getPostPaidAmountOfGift(),
						actual.getPostPaidAmountOfGift(),
						"验证OrderInfo.PostPaidAmountOfGift");
				DataUtil.verifyDateEquals(expect.getPostPaidTime(),
						actual.getPostPaidTime(), "验证OrderInfo.PostPaidTime");
				DataUtil.verify(expect.getQQ(), actual.getQQ(),
						"验证OrderInfo.QQ");
				DataUtil.verify(expect.getRealPaidAmountOfCash(),
						actual.getRealPaidAmountOfCash(),
						"验证OrderInfo.RealPaidAmountOfCash");
				DataUtil.verify(expect.getRealPaidAmountOfGift(),
						actual.getRealPaidAmountOfGift(),
						"验证OrderInfo.RealPaidAmountOfGift");
				DataUtil.verify(expect.getRealPay(), actual.getRealPay(),
						"验证OrderInfo.RealPay");
				DataUtil.verify(expect.getRealPostPay(),
						actual.getRealPostPay(), "验证OrderInfo.RealPostPay");
				DataUtil.verify(expect.getReceivePerson(),
						actual.getReceivePerson(), "验证OrderInfo.ReceivePerson");
				DataUtil.verify(expect.getRefund(), actual.getRefund(),
						"验证OrderInfo.Refund");
				DataUtil.verify(expect.getReplyTopicWhenOrderPaid(),
						actual.getReplyTopicWhenOrderPaid(),
						"验证OrderInfo.ReplyTopicWhenOrderPaid");
				//				DataUtil.verify(expect.getSellerLoginEmail(), actual.getSellerLoginEmail(),
				//								"验证OrderInfo.SellerLoginEmail");
				DataUtil.verify(expect.getSellerLoginId(),
						actual.getSellerLoginId(), "验证OrderInfo.SellerLoginId");
				DataUtil.verify(expect.getSellerNote(), actual.getSellerNote(),
						"验证OrderInfo.SellerNote");
				DataUtil.verify(expect.isShangouOrder(),
						actual.isShangouOrder(), "验证OrderInfo.ShangouOrder");
				DataUtil.verify(expect.getStockStatus(),
						actual.getStockStatus(), "验证OrderInfo.StockStatus");
				DataUtil.verify(expect.getTelephone(), actual.getTelephone(),
						"验证OrderInfo.Telephone");
				DataUtil.verify(expect.getThirdOrderId(),
						actual.getThirdOrderId(), "验证OrderInfo.ThirdOrderId");
				DataUtil.verify(expect.getThirdPartyRefundStatus(),
						actual.getThirdPartyRefundStatus(),
						"验证OrderInfo.ThirdPartyRefundStatus");
				DataUtil.verify(expect.getTitle(), actual.getTitle(),
						"验证OrderInfo.Title");
				DataUtil.verify(expect.getTopicId(), actual.getTopicId(),
						"验证OrderInfo.TopicId");
				DataUtil.verify(expect.getTotalPrice(), actual.getTotalPrice(),
						"验证OrderInfo.TotalPrice");
				DataUtil.verify(expect.getTradingId(), actual.getTradingId(),
						"验证OrderInfo.TradingId");
				DataUtil.verify(expect.getTradingStatus(),
						actual.getTradingStatus(), "验证OrderInfo.TradingStatus");
				DataUtil.verify(expect.getType(), actual.getType(),
						"验证OrderInfo.Type");
				//				DataUtil.verify(expect.getUnfreezeStatus(), actual.getUnfreezeStatus(), "验证OrderInfo.UnfreezeStatus");
				DataUtil.verify(expect.getUseFreeCardAmount(),
						actual.getUseFreeCardAmount(),
						"验证OrderInfo.UseFreeCardAmount");
				DataUtil.verify(expect.getUseGiftAmount(),
						actual.getUseGiftAmount(), "验证OrderInfo.UseGiftAmount");
				DataUtil.verify(expect.getUserId(), actual.getUserId(),
						"验证OrderInfo.UserId");
				DataUtil.verify(expect.getBusynessTypeList(),
						actual.getBusynessTypeList(),
						"验证OrderInfo.BusynessTypeList");
				DataUtil.verify(expect.getCancelReason(),
						actual.getCancelReason(), "验证OrderInfo.CancelReason");
				DataUtil.verify(expect.isHaveUploadedIdCard(),
						actual.isHaveUploadedIdCard(),
						"验证OrderInfo.HaveUploadedIdCard");
				//				DataUtil.verify(expect.getIsNewCustomerOrder(), actual.getIsNewCustomerOrder(),
				//								"验证OrderInfo.IsNewCustomerOrder");
				//				DataUtil.verify(expect.getIsNewSellerOrder(), actual.getIsNewSellerOrder(),
				//								"验证OrderInfo.IsNewSellerOrder");
				DataUtil.verify(expect.getLocalRefundApplyTime(),
						actual.getLocalRefundApplyTime(),
						"验证OrderInfo.LocalRefundApplyTime");
				DataUtil.verify(expect.getMainOrderId(),
						actual.getMainOrderId(), "验证OrderInfo.MainOrderId");
				DataUtil.verify(expect.isNeedUploadIdCard(),
						actual.isNeedUploadIdCard(),
						"验证OrderInfo.NeedUploadIdCard");
				DataUtil.verify(DataUtil.Booleann.GetValueOrDefault(expect
						.getPackageDelivery_DomesticDelivered()),
						DataUtil.Booleann.GetValueOrDefault(actual
								.getPackageDelivery_DomesticDelivered()),
						"验证OrderInfo.PackageDelivery_DomesticDelivered");
				//				DataUtil.verify(expect.getPaidAmountOfCoupon(), actual.getPaidAmountOfCoupon(),
				//								"验证OrderInfo.PaidAmountOfCoupon");
				DataUtil.verify(expect.getPaidAmountOfFreeCard(),
						actual.getPaidAmountOfFreeCard(),
						"验证OrderInfo.PaidAmountOfFreeCard");
				DataUtil.verify(expect.getPaidAmountOfYmtCoupon(),
						actual.getPaidAmountOfYmtCoupon(),
						"验证OrderInfo.PaidAmountOfYmtCoupon");
				DataUtil.verify(expect.getPayableAmount(),
						actual.getPayableAmount(), "验证OrderInfo.PayableAmount");
				DataUtil.verify(expect.getPromotionReducedAmount(),
						actual.getPromotionReducedAmount(),
						"验证OrderInfo.PromotionReducedAmount");
				DataUtil.verify(expect.getRealSettlementAmountOfCoupon(),
						actual.getRealSettlementAmountOfCoupon(),
						"验证OrderInfo.RealSettlementAmountOfCoupon");
				DataUtil.verify(expect.getRemarkLevel(),
						actual.getRemarkLevel(), "验证OrderInfo.RemarkLevel");
				DataUtil.verify(expect.getRiskVerifiedStatus(),
						actual.getRiskVerifiedStatus(),
						"验证OrderInfo.RiskVerifiedStatus");
				DataUtil.verify(expect.getSalesRefundStatus(),
						actual.getSalesRefundStatus(),
						"验证OrderInfo.SalesRefundStatus");
				DataUtil.verify(expect.getSellerCouponAmount(),
						actual.getSellerCouponAmount(),
						"验证OrderInfo.SellerCouponAmount");
				DataUtil.verify(expect.getSellerCouponCode(),
						actual.getSellerCouponCode(),
						"验证OrderInfo.SellerCouponCode");

				DataUtil.verify(expect.getTotalPriceChange(),
						actual.getTotalPriceChange(),
						"验证OrderInfo.TotalPriceChange");
				DataUtil.verify(expect.getTotalSalesRefundAmount(),
						actual.getTotalSalesRefundAmount(),
						"验证OrderInfo.TotalSalesRefundAmount");
				DataUtil.verify(expect.getYmtCouponAmount(),
						actual.getYmtCouponAmount(),
						"验证OrderInfo.YmtCouponAmount");
				DataUtil.verify(expect.getYmtCouponCode(),
						actual.getYmtCouponCode(), "验证OrderInfo.YmtCouponCode");

			}
		}
	}

	private void verifyOrderItemList(OrderItemInfo exp, OrderItemInfo act,
			String expPid) {
		DataUtil.verify(exp.getAmount(), act.getAmount(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的Amount");
		DataUtil.verify(exp.getBondedArea(), act.getBondedArea(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的BondedArea");
		DataUtil.verify(exp.getCatalogId(), act.getCatalogId(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的CatalogId");
		DataUtil.verify(exp.getDescription(), act.getDescription(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的Description");
		DataUtil.verify(exp.getDiscount(), act.getDiscount(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的Discount");
		DataUtil.verify(exp.getFreight(), act.getFreight(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的Freight");
		DataUtil.verify(
				DataUtil.Booleann.GetValueOrDefault(exp.getFreightFree()),
				DataUtil.Booleann.GetValueOrDefault(act.getFreightFree()),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的FreightFree");
		DataUtil.verify(exp.isIsCost(), act.isIsCost(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的IsCost");
		DataUtil.verify(exp.getItemType(), act.getItemType(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的ItemType");
		DataUtil.verify(exp.getLogisticsType(), act.getLogisticsType(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的LogisticsType");
		DataUtil.verify(exp.getOrderItemId(), act.getOrderItemId(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的OrderItemId");
		DataUtil.verify(exp.getPictureUrl(), act.getPictureUrl(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的PictureUrl");
		DataUtil.verify(exp.getPremium(), act.getPremium(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的Premium");
		DataUtil.verify(exp.getPrice(), act.getPrice(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的Price");
		DataUtil.verify(exp.getPriceType(), act.getPriceType(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的PriceType");
		DataUtil.verify(exp.getProductId(), act.getProductId(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的ProductId");
		DataUtil.verify(exp.getProductOriginalPrice(),
				act.getProductOriginalPrice(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的ProductOriginalPrice");
		DataUtil.verify(exp.getProductPrice(), act.getProductPrice(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的ProductPrice");
		DataUtil.verify(exp.getProductRefundChannel(),
				act.getProductRefundChannel(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的ProductRefundChannel");
		if (exp.getPromotion() == null) {
			DataUtil.verify(true, act.getPromotion() == null,
					"验证OrderInfo.OrderItemList中ProductId=[" + expPid
							+ "]的Promotion == null");
		} else {
			verifyProductPromotion(expPid, exp.getPromotion(),
					act.getPromotion());
		}
		DataUtil.verify(exp.getPropertyInfo(), act.getPropertyInfo(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的PropertyInfo");

		DataUtil.verify(exp.getRefundBillNo(), act.getRefundBillNo(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的RefundBillNo");
		DataUtil.verify(exp.isSailProtected(), act.isSailProtected(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的SailProtected");
		DataUtil.verify(exp.getSalesType(), act.getSalesType(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的SalesType");
		DataUtil.verify(exp.getSellerCouponAmount(),
				act.getSellerCouponAmount(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的SellerCouponAmount");
		DataUtil.verify(exp.getSku(), act.getSku(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的Sku");
		DataUtil.verify(exp.getStockStatus(), act.getStockStatus(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的StockStatus");
		DataUtil.verify(exp.getSubProductCategoryId(),
				act.getSubProductCategoryId(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的SubProductCategoryId");
		DataUtil.verify(exp.isSupportRtnWithoutReason(),
				act.isSupportRtnWithoutReason(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的SupportRtnWithoutReason");
		DataUtil.verify(exp.getTariffType(), act.getTariffType(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的TariffType");
		DataUtil.verify(exp.getTitle(), act.getTitle(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的Title");
		DataUtil.verify(exp.getYmtCouponAmount(), act.getYmtCouponAmount(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的YmtCouponAmount");
		DataUtil.verify(exp.isPreSale(), act.isPreSale(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid + "]的PreSale");
		DataUtil.verify(exp.getThirdPartyDiscount(),
				act.getThirdPartyDiscount(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的ThirdPartyDiscount");
		DataUtil.verify(exp.isPspProduct(), act.isPspProduct(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的PspProduct");
		OrderItemInfoExt expExt = exp.getOrderItemInfoExt();
		OrderItemInfoExt actExt = act.getOrderItemInfoExt();
		if (null == expExt) {
			DataUtil.verify(expExt, actExt,
					"验证OrderInfo.OrderItemList中ProductId=[" + expPid
							+ "]的OrderItemInfoExt");
		} else {
			DataUtil.verify(expExt.getActivityId(), actExt.getActivityId(),
					"验证OrderInfo.OrderItemList中ProductId=[" + expPid
							+ "]的OrderItemInfoExt.ActivityId");
			DataUtil.verify(expExt.getActivityTemplateId(),
					actExt.getActivityTemplateId(),
					"验证OrderInfo.OrderItemList中ProductId=[" + expPid
							+ "]的OrderItemInfoExt.ActivityTemplateId");
			DataUtil.verify(expExt.getGiftAvail4Reward(),
					actExt.getGiftAvail4Reward(),
					"验证OrderInfo.OrderItemList中ProductId=[" + expPid
							+ "]的OrderItemInfoExt.GiftAvail4Reward");
		}
	}

	private void verifyProductPromotion(String expPid, ProductPromotion expect,
			ProductPromotion actual) {
		DataUtil.verify(expect.getCondition(), actual.getCondition(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的Promotion.Condition");
		DataUtil.verify(expect.getContent(), actual.getContent(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的Promotion.Content");
		DataUtil.verify(expect.getID(), actual.getID(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的Promotion.ID");
		DataUtil.verify(expect.getName(), actual.getName(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的Promotion.Name");
		DataUtil.verify(expect.getPartialReducedAmount(),
				actual.getPartialReducedAmount(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的Promotion.PartialReducedAmount");
		DataUtil.verify(expect.getReducedAmount(), actual.getReducedAmount(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的Promotion.ReducedAmount");
		DataUtil.verify(expect.getType(), actual.getType(),
				"验证OrderInfo.OrderItemList中ProductId=[" + expPid
						+ "]的Promotion.Type");
	}

	/**
	 * 校验组合商品
	 * @param expectId
	 * @param actProducts
	 */
	private static void verifySubProducts(int expectId, OrderItemInfo actProduct) {

		DefaultWapper data = new DefaultWapper();

		try {

			String catalogId = actProduct.getCatalogId();

			List<SubProductInfo> actualOrderInfoSub = actProduct
					.getSubProductInfos();

			List<OrderInfoSubPo> expectOrderInfoSub = data.getOrderInfoSub(
					expectId, catalogId);

			if (!CollectionUtils.isEmpty(expectOrderInfoSub)) {

				DataUtil.verifyEquals(expectOrderInfoSub.size(),
						actualOrderInfoSub.size(), "验证id=[" + expectId
								+ "]Products 下组合商品记录数");

				boolean flag = expectOrderInfoSub.size() == actualOrderInfoSub
						.size();

				if (flag) {
					Logger.comment("开始验证catalogId=[" + catalogId
							+ "]的Products下的组合商品");

					for (int i = 0; i < expectOrderInfoSub.size(); i++) {

						OrderInfoSubPo expect = expectOrderInfoSub.get(i);
						SubProductInfo actual = actualOrderInfoSub.get(i);

						Logger.verifyEquals(expect.getSubTitle(),
								actual.getSubTitle(), "校验组合商品 subTitle");
						Logger.verifyEquals(expect.getSubCatalogId(),
								actual.getSubCatalogId(), "校验组合商品 subCatalogId");
						Logger.verifyEquals(expect.getFirstCatId(),
								actual.getFirstCatId(), "校验组合商品 firstCatId");

						Logger.verifyEquals(expect.getSecondCatId(),
								actual.getSecondCatId(), "校验组合商品 secondCatId");

						Logger.verifyEquals(expect.getThirdCatId(),
								actual.getThirdCatId(), "校验组合商品 thirdCatId");

						Logger.verifyEquals(expect.getNum(), actual.getNum(),
								"校验组合商品 num");

						DataUtil.verifyDecimalEquals(expect.getOriginalPrice(),
								actual.getOriginalPrice(),
								"校验组合商品 originalPrice");

						DataUtil.verifyDecimalEquals(expect.getPrice(),
								actual.getPrice(), "校验组合商品 price");

						DataUtil.verifyDecimalEquals(expect.getFreight(),
								actual.getFreight(), "校验组合商品 freight");

						DataUtil.verifyDecimalEquals(expect.getDiscount(),
								actual.getDiscount(), "校验组合商品 discount");

						DataUtil.verifyDecimalEquals(expect.getYmtCoupon(),
								actual.getYmtCoupon(), "校验组合商品 ymtCoupon");

						DataUtil.verifyDecimalEquals(expect.getSellerCoupon(),
								actual.getSellerCoupon(), "校验组合商品 sellerCoupon");

						DataUtil.verifyDecimalEquals(
								expect.getThirdPartyDiscount(),
								actual.getThirdPartyDiscount(),
								"校验组合商品 thirdPartyDiscount");

						DataUtil.verifyDecimalEquals(expect.getPromotion(),
								actual.getPromotion(), "校验组合商品 promotion");

					}

				}
			}

		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
	private void ConstructExpectedResponse(GetSingleOrderInfoResponse response) {
		Sp_GetSingleOrderInfo_1 sp = new Sp_GetSingleOrderInfo_1();
		sp.setOrderId(gsoibean.getOrderId());
		sp.setUserId(gsoibean.getUserId());
		sp.execute();
		OrderEntities result = ConvertResult(sp);
		List<com.ymatou.query.seller.trading.api.parameter.OrderInfo> orderInfos = OrderConverter
				.AsOrderInfos(result, false);
		if (DataUtil.isNullOrEmpty(orderInfos)) {
			response.setOrderInfo(null);
		} else {
			response.setOrderInfo(orderInfos.get(0));
		}
		changeSalesRefundStatus(response);
	}

	private void changeSalesRefundStatus(GetSingleOrderInfoResponse response) {
		if (response.getOrderInfo() != null) {
			int[] orderIds = {response.getOrderInfo().getOrderId()};
			Map<Integer, Integer> ordersRefund = new Common()
					.getSalesRefundStatus(orderIds);
			Iterator<Integer> iterator = ordersRefund.keySet().iterator();
			while (iterator.hasNext()) {
				int orderId = iterator.next();
				response.getOrderInfo().setSalesRefundStatus(
						ordersRefund.get(orderId));
			}
		}
	}

	private OrderEntities ConvertResult(Sp_GetSingleOrderInfo_1 sp) {
		OrderEntities result = new OrderEntities();
		OrderEntities entity = new OrderEntities();
		List<Ymt_Order> Orders = new ArrayList<Ymt_Order>();
		List<Ymt_CreditDetail> CreditDetails = new ArrayList<Ymt_CreditDetail>();
		List<Ymt_O_OrderNote> OrderNotes = new ArrayList<Ymt_O_OrderNote>();
		List<Ymt_OrderState> OrderStates = new ArrayList<Ymt_OrderState>();
		List<Ymt_OrderPostPay> PostPays = new ArrayList<Ymt_OrderPostPay>();
		List<Ymt_OrderInfo> OrderInfos = new ArrayList<Ymt_OrderInfo>();
		List<Ymt_OrderSummary> OrderSummaries = new ArrayList<Ymt_OrderSummary>();
		List<Ymt_Order_Frozen> OrderFrozens = new ArrayList<Ymt_Order_Frozen>();
		List<Ymt_OrderToBill> OrderToBills = new ArrayList<Ymt_OrderToBill>();
		List<Ymt_Bill> Bills = new ArrayList<Ymt_Bill>();
		List<Ymt_TradingItem> TradingItems = new ArrayList<Ymt_TradingItem>();
		List<Ymt_OrderExt> OrderExts = new ArrayList<Ymt_OrderExt>();
		if (DataUtil.isNullOrEmpty(sp.getOrders()) == false) {
			for (Map m : sp.getOrders()) {
				Ymt_Order o = new Ymt_Order();
				// o.setTotalRefundThirdPartyDiscount(DataUtil.BigDecimall
				// .GetValueOrDefault(
				// m.get("totalRefundThirdPartyDiscount"),
				// new BigDecimal(0)));
				o.setbPreSale(DataUtil.Booleann.GetValueOrDefault(
						m.get("bPreSale"), false));
				o.setbCanLocalReturn(DataUtil.Booleann.GetValueOrDefault(
						m.get("bCanLocalReturn"), false));
				o.setbPaidInFull(DataUtil.Booleann.GetValueOrDefault(
						m.get("bPaidInFull"), false));
				o.setbShangouOrder(DataUtil.Booleann.GetValueOrDefault(
						m.get("bShangouOrder"), false));
				o.setbShippedByXlobo(DataUtil.Booleann.GetValueOrDefault(
						m.get("bShippedByXlobo"), false));
				o.setCouponValue(DataUtil.BigDecimall.GetValueOrNull(m
						.get("CouponValue")));
				o.setdAcceptTime(DataUtil.Stringg.getValueOrNull(m
						.get("dAcceptTime")));
				o.setdAddTime(DataUtil.Stringg.getValueOrNull(m.get("dAddTime")));
				o.setdApplyLocalReturnTime(DataUtil.Stringg.getValueOrNull(m
						.get("dApplyLocalReturnTime")));
				o.setdApplyPostPayTime(DataUtil.Stringg.getValueOrNull(m
						.get("dApplyPostPayTime")));
				o.setdCancelTime(DataUtil.Stringg.getValueOrNull(m
						.get("dCancelTime")));
				o.setdChangeAddressTime(DataUtil.Stringg.getValueOrNull(m
						.get("dChangeAddressTime")));
				o.setdConfirmedTime(DataUtil.Stringg.getValueOrNull(m
						.get("dConfirmedTime")));
				o.setdDiscountTime(DataUtil.Stringg.getValueOrNull(m
						.get("dDiscountTime")));
				o.setdDispathTime(DataUtil.Stringg.getValueOrNull(m
						.get("dDispathTime")));
				o.setdOperateExpireTime(DataUtil.Stringg.getValueOrNull(m
						.get("dOperateExpireTime")));
				o.setdPaidTime(DataUtil.Stringg.getValueOrNull(m
						.get("dPaidTime")));
				o.setdPostPaidTime(DataUtil.Stringg.getValueOrNull(m
						.get("dPostPaidTime")));
				o.setfAutoCancelOrderHours(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fAutoCancelOrderHours"),
								new BigDecimal(0)));
				o.setfDiscount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fDiscount")));
				o.setfFreight(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fFreight")));
				o.setfOldDiscount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fOldDiscount")));
				o.setfOldFreight(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fOldFreight")));
				o.setfOrderDiscount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fOrderDiscount")));
				o.setfOrderPrice(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fOrderPrice")));
				o.setfTotalPrice(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fTotalPrice"), new BigDecimal(0)));
				o.setfUseFreeCardAmount(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fUseFreeCardAmount"), new BigDecimal(0)));
				o.setfUseGiftAmount(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fUseGiftAmount"), new BigDecimal(0)));
				o.setiBuyerId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iBuyerId"), 0));
				o.setiCouponType(DataUtil.Integerr.GetValueOrDefault(
						m.get("iCouponType"), null));
				o.setiDistributor(DataUtil.Integerr.GetValueOrDefault(
						m.get("iDistributor"), 0));
				o.setiIsMerchant(DataUtil.Integerr.GetValueOrDefault(
						m.get("iIsMerchant"), 0));
				o.setiOperate(DataUtil.Integerr.GetValueOrDefault(
						m.get("iOperate"), null));
				o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iOrderId"), 0));
				o.setiReplyTopicWhenOrderPaid(DataUtil.Integerr
						.GetValueOrDefault(m.get("iReplyTopicWhenOrderPaid"),
								null));
				o.setiTopicId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iTopicId"), null));
				o.setiTradingId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iTradingId"), null));
				o.setiTradingStatus(DataUtil.Integerr.GetValueOrDefault(
						m.get("iTradingStatus"), null));
				o.setiType(DataUtil.Integerr.GetValueOrDefault(m.get("iType"),
						0));
				o.setiUnfreezeStatus(DataUtil.Integerr.GetValueOrDefault(
						m.get("iUnfreezeStatus"), null));
				o.setiUserId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iUserId"), 0));
				o.setsAddress(DataUtil.Stringg.getValueOrNull(m.get("sAddress")));
				o.setsBuyerLoginEmail(DataUtil.Stringg.getValueOrNull(m
						.get("sBuyerLoginEmail")));
				o.setsBuyerLoginId(DataUtil.Stringg.getValueOrNull(m
						.get("sBuyerLoginId")));
				o.setsBuyerNickName(DataUtil.Stringg.getValueOrNull(m
						.get("sBuyerNickName")));
				o.setsCouponCode(DataUtil.Stringg.getValueOrNull(m
						.get("sCouponCode")));
				o.setsEmail(DataUtil.Stringg.getValueOrNull(m.get("sEmail")));
				o.setsLeaveWord(DataUtil.Stringg.getValueOrNull(m
						.get("sLeaveWord")));
				o.setsMarkId(DataUtil.Stringg.getValueOrNull(m.get("sMarkId")));
				o.setsPhone(DataUtil.Stringg.getValueOrNull(m.get("sPhone")));
				o.setsPostCode(DataUtil.Stringg.getValueOrNull(m
						.get("sPostCode")));
				o.setsQQ(DataUtil.Stringg.getValueOrNull(m.get("sQQ")));
				o.setsReceivePerson(DataUtil.Stringg.getValueOrNull(m
						.get("sReceivePerson")));
				o.setsSellerLoginEmail(DataUtil.Stringg.getValueOrNull(m
						.get("sSellerLoginEmail")));
				o.setsSellerLoginId(DataUtil.Stringg.getValueOrNull(m
						.get("sSellerLoginId")));
				o.setsTelephone(DataUtil.Stringg.getValueOrNull(m
						.get("sTelephone")));
				o.setsThirdOrderId(DataUtil.Stringg.getValueOrNull(m
						.get("sThirdOrderId")));
				o.setsTitle(DataUtil.Stringg.getValueOrNull(m.get("sTitle")));
				o.setiRiskVerifiedStatus(DataUtil.Integerr.GetValueOrDefault(
						m.get("iRiskVerifiedStatus"), 0));
				o.setiThirdPartyRefundStatus(DataUtil.Integerr
						.GetValueOrDefault(m.get("iThirdPartyRefundStatus"),
								null));
				o.setiCouponChannel(DataUtil.Integerr.GetValueOrDefault(
						m.get("iCouponChannel"), 0));
				o.setiSalesRefundStatus(DataUtil.Integerr.GetValueOrDefault(
						m.get("iSalesRefundStatus"), null));
				o.setTotalSalesRefundAmount(DataUtil.BigDecimall
						.GetValueOrNull(m.get("TotalSalesRefundAmount")));
				o.setbDomesticDelivered(DataUtil.Booleann.GetValueOrDefault(
						m.get("bDomesticDelivered"), null));
				o.setsReason(DataUtil.Stringg.getValueOrNull(m.get("sReason")));
				o.setsSellerCouponCode(DataUtil.Stringg.getValueOrNull(m
						.get("sSellerCouponCode")));
				o.setfSellerCouponAmount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fSellerCouponAmount")));
				o.setsYmtCouponCode(DataUtil.Stringg.getValueOrNull(m
						.get("sYmtCouponCode")));
				o.setfYmtCouponAmount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fYmtCouponAmount")));
				o.setfPayableAmount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fPayableAmount")));
				o.setRealSettlementAmountOfCoupon(DataUtil.BigDecimall
						.GetValueOrDefault(
								m.get("RealSettlementAmountOfCoupon"),
								new BigDecimal(0)));
				o.setiMainOrderId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iMainOrderId"), 0));
				o.setiRemarkLevel(DataUtil.Integerr.GetValueOrDefault(
						m.get("iRemarkLevel"), null));
				o.setRemarkContent(DataUtil.Stringg.getValueOrNull(m
						.get("RemarkContent")));
				o.setBusynessTypes(DataUtil.Stringg.getValueOrNull(m
						.get("BusynessTypes")));
				o.setfSellerPromotionAmount(DataUtil.BigDecimall
						.GetValueOrNull(m.get("fSellerPromotionAmount")));
				Orders.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(sp.getCreditDetails()) == false) {
			for (Map m : sp.getCreditDetails()) {
				Ymt_CreditDetail o = new Ymt_CreditDetail();
				o.setbFromPurchaseAgent(DataUtil.Booleann.GetValueOrDefault(
						m.get("bFromPurchaseAgent"), null));
				o.setdAddTime(DataUtil.Stringg.getValueOrNull(m.get("dAddTime")));
				o.setdSellerReplyUpdateTime(DataUtil.Stringg.getValueOrNull(m
						.get("dSellerReplyUpdateTime")));
				o.setdUpdateTime(DataUtil.Stringg.getValueOrDefault(
						m.get("dUpdateTime"), "0001-01-01 00:00:00"));
				o.setfPoint(DataUtil.Doublee.getValueOrDefault(m.get("fPoint"),
						0.0));
				o.setfPoint2(DataUtil.Doublee.getValueOrDefault(
						m.get("fPoint2"), null));
				o.setiAction(DataUtil.Integerr.GetValueOrDefault(
						m.get("iAction"), 0));
				o.setiPoint3(DataUtil.Integerr.GetValueOrDefault(
						m.get("iPoint3"), 0));
				o.setiSort(DataUtil.Integerr.GetValueOrDefault(m.get("iSort"),
						0));
				o.setiTargetUserId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iTargetUserId"), null));
				o.setiType(DataUtil.Integerr.GetValueOrDefault(m.get("iType"),
						0));
				o.setiUserId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iUserId"), 0));
				o.setsDescription(DataUtil.Stringg.getValueOrNull(m
						.get("sDescription")));
				o.setsIP(DataUtil.Stringg.getValueOrNull(m.get("sIP")));
				o.setsSellerReply(DataUtil.Stringg.getValueOrNull(m
						.get("sSellerReply")));
				o.setsTargetId(DataUtil.Stringg.getValueOrNull(m
						.get("sTargetId")));
				CreditDetails.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(sp.getNotes()) == false) {
			for (Map m : sp.getNotes()) {
				Ymt_O_OrderNote o = new Ymt_O_OrderNote();
				o.setdAddTime(DataUtil.Stringg.getValueOrDefault(
						m.get("dAddTime"), "0001-01-01 00:00:00"));
				o.setiId(DataUtil.Integerr.GetValueOrDefault(m.get("iId"), 0));
				o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iOrderId"), 0));
				o.setiUserId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iUserId"), 0));
				o.setsContent(DataUtil.Stringg.getValueOrNull(m.get("sContent")));
				o.setiRemarkLevel(DataUtil.Integerr.GetValueOrDefault(
						m.get("iRemarkLevel"), null));
				OrderNotes.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(sp.getStates()) == false) {
			for (Map m : sp.getStates()) {
				Ymt_OrderState o = new Ymt_OrderState();
				o.setfDiscountOfThirdParty(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fDiscountOfThirdParty"),
								new BigDecimal(0)));
				o.setfCommissionFee(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fCommissionFee"), new BigDecimal(0)));
				o.setfNeedCommissionFee(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fNeedCommissionFee"), new BigDecimal(0)));
				o.setfPaidAmountOfCash(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fPaidAmountOfCash"), new BigDecimal(0)));
				o.setfPaidAmountOfCoupon(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fPaidAmountOfCoupon"),
								new BigDecimal(0)));
				o.setfPaidAmountOfFreeCard(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fPaidAmountOfFreeCard"),
								new BigDecimal(0)));
				o.setfPaidAmountOfGift(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fPaidAmountOfGift"), new BigDecimal(0)));
				o.setfPostPadiAmountOfCoupon(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fPostPadiAmountOfCoupon"),
								new BigDecimal(0)));
				o.setfPostPaidAmountOfCash(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fPostPaidAmountOfCash"),
								new BigDecimal(0)));
				o.setfPostPaidAmountOfGift(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fPostPaidAmountOfGift"),
								new BigDecimal(0)));
				o.setfQuickTurnoverAmount(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fQuickTurnoverAmount"),
								new BigDecimal(0)));
				o.setfRefundedAmountOfCash(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fRefundedAmountOfCash"),
								new BigDecimal(0)));
				o.setfRefundedAmountOfCoupon(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fRefundedAmountOfCoupon"),
								new BigDecimal(0)));
				o.setfRefundedAmountOfGift(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fRefundedAmountOfGift"),
								new BigDecimal(0)));
				o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iOrderId"), 0));
				o.setfPaidAmountOfSellerCoupon(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fPaidAmountOfSellerCoupon"),
								new BigDecimal(0)));
				o.setfPaidAmountOfYmtCoupon(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fPaidAmountOfYmtCoupon"),
								new BigDecimal(0)));
				o.setfRefundedDiscountOfThirdParty(DataUtil.BigDecimall
						.GetValueOrDefault(
								m.get("fRefundedDiscountOfThirdParty"),
								new BigDecimal(0)));
				OrderStates.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(sp.getPostPays()) == false) {
			for (Map m : sp.getPostPays()) {
				Ymt_OrderPostPay o = new Ymt_OrderPostPay();
				o.setdAddTime(DataUtil.Stringg.getValueOrDefault(
						m.get("dAddTime"), "0001-01-01 00:00:00"));
				o.setdUpdateTime(DataUtil.Stringg.getValueOrDefault(
						m.get("dUpdateTime"), "0001-01-01 00:00:00"));
				o.setfAmount(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fAmount"), new BigDecimal(0)));
				o.setfUseGiftAmount(DataUtil.BigDecimall.GetValueOrDefault(
						m.get("fUseGiftAmount"), new BigDecimal(0)));
				o.setiAction(DataUtil.Integerr.GetValueOrDefault(
						m.get("iAction"), 0));
				o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iOrderId"), 0));
				o.setiUseGift(DataUtil.Integerr.GetValueOrDefault(
						m.get("iUseGift"), 0));
				o.setsComment(DataUtil.Stringg.getValueOrNull(m.get("sComment")));
				o.setsId(DataUtil.Stringg.getValueOrNull(m.get("sId")));
				o.setHasTradingPassword(DataUtil.Booleann.GetValueOrDefault(
						m.get("HasTradingPassword"), false));
				PostPays.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(sp.getInfos()) == false) {
			for (Map m : sp.getInfos()) {
				Ymt_OrderInfo o = new Ymt_OrderInfo();
				o.setbPspProduct(DataUtil.Booleann.GetValueOrDefault(
						m.get("bPspProduct"), false));
				o.setbPreSale(DataUtil.Booleann.GetValueOrDefault(
						m.get("bPreSale"), false));
				o.setfThirdPartyDiscount(DataUtil.BigDecimall
						.GetValueOrDefault(m.get("fThirdPartyDiscount")));
				o.setbForVip(DataUtil.Booleann.GetValueOrDefault(
						m.get("bForVip"), false));
				o.setfDiscount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fDiscount")));
				o.setfOriginalPrice(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fOriginalPrice")));
				o.setfTotalPrice(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fTotalPrice")));
				o.setiAmount(DataUtil.Integerr.GetValueOrDefault(
						m.get("iAmount"), null));
				o.setiBondedArea(DataUtil.Integerr.GetValueOrDefault(
						m.get("iBondedArea"), null));
				o.setiCatalogStatus(DataUtil.Integerr.GetValueOrDefault(
						m.get("iCatalogStatus"), 0));
				o.setiCatalogType(DataUtil.Integerr.GetValueOrDefault(
						m.get("iCatalogType"), 0));
				o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iOrderId"), 0));
				o.setiProductBrandId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iProductBrandId"), 0));
				o.setiProductMainCategoryId(DataUtil.Integerr
						.GetValueOrDefault(m.get("iProductMainCategoryId"), 0));
				o.setiProductSubCategoryId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iProductSubCategoryId"), 0));
				o.setiProductThirdCategoryId(DataUtil.Integerr
						.GetValueOrDefault(m.get("iProductThirdCategoryId"), 0));
				o.setiProductType(DataUtil.Integerr.GetValueOrDefault(
						m.get("iProductType"), 0));
				o.setiSailProtected((Integer) m.get("iCatalogStatus") == 3);
				o.setiType(DataUtil.Integerr.GetValueOrDefault(m.get("iType"),
						0));
				o.setsCatalogId(DataUtil.Stringg.getValueOrNull(m
						.get("sCatalogId")));
				o.setsDescription(DataUtil.Stringg.getValueOrNull(m
						.get("sDescription")));
				o.setsOrderInfoId(DataUtil.Stringg.getValueOrNull(m
						.get("sOrderInfoId")));
				o.setsPictureUrl(DataUtil.Stringg.getValueOrNull(m
						.get("sPictureUrl")));
				o.setsProductCode(DataUtil.Stringg.getValueOrNull(m
						.get("sProductCode")));
				o.setsProductId(DataUtil.Stringg.getValueOrNull(m
						.get("sProductId")));
				o.setsPropertyInfo(DataUtil.Stringg.getValueOrNull(m
						.get("sPropertyInfo")));
				o.setsReferenceUrl(DataUtil.Stringg.getValueOrNull(m
						.get("sReferenceUrl")));
				o.setsSKU(DataUtil.Stringg.getValueOrNull(m.get("sSKU")));
				o.setsTitle(DataUtil.Stringg.getValueOrNull(m.get("sTitle")));
				o.setsOrderInfoExtId(DataUtil.Stringg.getValueOrNull(m
						.get("sOrderInfoExtId")));
				o.setiActivityId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iActivityId"), null));
				o.setiActivityTemplateId(DataUtil.Integerr.GetValueOrDefault(
						m.get("iActivityTemplateId"), null));
				o.setbGiftAvail4Reward(DataUtil.Booleann.GetValueOrDefault(
						m.get("bGiftAvail4Reward"), null));
				o.setiPriceType(DataUtil.Integerr.GetValueOrDefault(
						m.get("iPriceType"), 0));
				o.setiProductRefundChannel(DataUtil.Integerr.GetValueOrDefault(
						m.get("iProductRefundChannel"), 0));
				o.setfSellerCouponAmount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fSellerCouponAmount")));
				o.setfYmtCouponAmount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fYmtCouponAmount")));
				o.setfFreight(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fFreight")));
				o.setfProductPrice(DataUtil.BigDecimall.GetValueOrNull(m
						.get("fProductPrice")));
				o.setRefundBillNo(DataUtil.Stringg.getValueOrNull(m
						.get("RefundBillNo")));
				o.setiTariffType(DataUtil.Integerr.GetValueOrDefault(
						m.get("iTariffType"), 0));
				o.setfProductOriginalPrice(DataUtil.BigDecimall
						.GetValueOrNull(m.get("fProductOriginalPrice")));
				o.setiSalesType(DataUtil.Integerr.GetValueOrDefault(
						m.get("iSalesType"), null));
				o.setPromotionId(DataUtil.Integerr.GetValueOrDefault(
						m.get("PromotionId"), null));
				o.setPromotionType(DataUtil.Integerr.GetValueOrDefault(
						m.get("PromotionType"), null));
				o.setPromotionName(DataUtil.Stringg.getValueOrNull(m
						.get("PromotionName")));
				o.setMatchCondition(DataUtil.Stringg.getValueOrNull(m
						.get("MatchCondition")));
				o.setPromotionValue(DataUtil.Stringg.getValueOrNull(m
						.get("PromotionValue")));
				o.setfSellerPromotionAmount(DataUtil.BigDecimall
						.GetValueOrNull(m.get("fSellerPromotionAmount")));
				o.setReducedAmount(DataUtil.BigDecimall.GetValueOrNull(m
						.get("ReducedAmount")));
				o.setbSupportRtnWithoutReason(DataUtil.Booleann
						.GetValueOrDefault(m.get("bSupportRtnWithoutReason"),
								false));
				o.setbFreightFree(DataUtil.Booleann.GetValueOrDefault(
						m.get("bFreightFree"), null));
				OrderInfos.add(o);
			}
			if (DataUtil.isNullOrEmpty(sp.getSummarys()) == false) {
				for (Map m : sp.getSummarys()) {
					Ymt_OrderSummary o = new Ymt_OrderSummary();
					o.setdAddTime(DataUtil.Stringg.getValueOrNull(m
							.get("dAddTime")));
					o.setfGoodWeight(DataUtil.Doublee.getValueOrDefault(
							m.get("fGoodWeight"), 0.0));
					o.setiBillType(DataUtil.Integerr.GetValueOrDefault(
							m.get("iBillType"), null));
					o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iOrderId"), null));
					o.setiType(DataUtil.Integerr.GetValueOrDefault(
							m.get("iType"), null));
					o.setsLogisticsProvider(DataUtil.Stringg.getValueOrNull(m
							.get("sLogisticsProvider")));
					o.setsOrderSummaryId(DataUtil.Stringg.getValueOrNull(m
							.get("sOrderSummaryId")));
					o.setsSummary(DataUtil.Stringg.getValueOrNull(m
							.get("sSummary")));
					OrderSummaries.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(sp.getOrderFrozens()) == false) {
				for (Map m : sp.getOrderFrozens()) {
					Ymt_Order_Frozen o = new Ymt_Order_Frozen();
					o.setbPause(DataUtil.Booleann.GetValueOrDefault(
							m.get("bPause"), false));
					o.setbFrozen(DataUtil.Booleann.GetValueOrDefault(
							m.get("bFrozen"), false));
					o.setbFrozenAutoReceive(DataUtil.Booleann
							.GetValueOrDefault(m.get("bFrozenAutoReceive"),
									false));
					o.setdAddTime(DataUtil.Stringg.getValueOrDefault(
							m.get("dAddTime"), "0001-01-01 00:00:00"));
					o.setdFrozenTime(DataUtil.Stringg.getValueOrNull(m
							.get("dFrozenTime")));
					o.setdUpdateTime(DataUtil.Stringg.getValueOrNull(m
							.get("dUpdateTime")));
					o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iOrderId"), 0));
					o.setiUserId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iUserId"), null));
					o.setsMemo(DataUtil.Stringg.getValueOrNull(m.get("sMemo")));
					OrderFrozens.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(sp.getOrderToBills()) == false) {
				for (Map m : sp.getOrderToBills()) {
					Ymt_OrderToBill o = new Ymt_OrderToBill();
					o.setiAction(DataUtil.Integerr.GetValueOrDefault(
							m.get("iAction"), 0));
					o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iOrderId"), 0));
					o.setsBillId(DataUtil.Stringg.getValueOrNull(m
							.get("sBillId")));
					o.setsId(DataUtil.Stringg.getValueOrNull(m.get("sId")));
					OrderToBills.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(sp.getBills()) == false) {
				for (Map m : sp.getBills()) {
					Ymt_Bill o = new Ymt_Bill();
					o.setbDownloaded(DataUtil.Booleann.GetValueOrDefault(
							m.get("bDownloaded"), false));
					o.setdAddTime(DataUtil.Stringg.getValueOrDefault(
							m.get("dAddTime"), "0001-01-01 00:00:00"));
					o.setdMatchIdPicTime(DataUtil.Stringg.getValueOrNull(m
							.get("dMatchIdPicTime")));
					o.setdWeightNotifyDateTime(DataUtil.Stringg
							.getValueOrNull(m.get("dWeightNotifyDateTime")));
					o.setfBillFee(DataUtil.BigDecimall.GetValueOrNull(m
							.get("fBillFee")));
					o.setfDeclarePrice(DataUtil.BigDecimall.GetValueOrNull(m
							.get("fDeclarePrice")));
					o.setfDeclareWeight(DataUtil.BigDecimall.GetValueOrNull(m
							.get("fDeclareWeight")));
					o.setfInsure(DataUtil.BigDecimall.GetValueOrNull(m
							.get("fInsure")));
					o.setfRealWeight(DataUtil.BigDecimall.GetValueOrNull(m
							.get("fRealWeight")));
					o.setfServiceCost(DataUtil.BigDecimall.GetValueOrDefault(
							m.get("fServiceCost"), new BigDecimal(0)));
					o.setfTxtFee(DataUtil.BigDecimall.GetValueOrNull(m
							.get("fTxtFee")));
					o.setfWeightFee(DataUtil.BigDecimall.GetValueOrNull(m
							.get("fWeightFee")));
					o.setiAction(DataUtil.Integerr.GetValueOrDefault(
							m.get("iAction"), 0));
					o.setiFromUserId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iFromUserId"), null));
					o.setiLogisticId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iLogisticId"), 0));
					o.setiLogisticsStatu(DataUtil.Integerr.GetValueOrDefault(
							m.get("iLogisticsStatu"), 0));
					o.setiSignLogisticId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iSignLogisticId"), 0));
					o.setiToUserId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iToUserId"), null));
					o.setiTransportServiceType(DataUtil.Integerr
							.GetValueOrDefault(m.get("iTransportServiceType"),
									0));
					o.setiTxtChargeStatu(DataUtil.Integerr.GetValueOrDefault(
							m.get("iTxtChargeStatu"), 0));
					o.setiWeightChargeStatu(DataUtil.Integerr
							.GetValueOrDefault(m.get("iWeightChargeStatu"), 0));
					o.setsBillCode(DataUtil.Stringg.getValueOrNull(m
							.get("sBillCode")));
					o.setsBillId(DataUtil.Stringg.getValueOrNull(m
							.get("sBillId")));
					o.setsBillSupplier(DataUtil.Stringg.getValueOrNull(m
							.get("sBillSupplier")));
					o.setsBillUrl(DataUtil.Stringg.getValueOrNull(m
							.get("sBillUrl")));
					o.setsDeclineReason(DataUtil.Stringg.getValueOrNull(m
							.get("sDeclineReason")));
					o.setsDelReason(DataUtil.Stringg.getValueOrNull(m
							.get("sDelReason")));
					o.setsGoodName(DataUtil.Stringg.getValueOrNull(m
							.get("sGoodName")));
					o.setsIdCardPic(DataUtil.Stringg.getValueOrNull(m
							.get("sIdCardPic")));
					o.setsReceiveAddress(DataUtil.Stringg.getValueOrNull(m
							.get("sReceiveAddress")));
					o.setsReceiveCity(DataUtil.Stringg.getValueOrNull(m
							.get("sReceiveCity")));
					o.setsReceiveEmail(DataUtil.Stringg.getValueOrNull(m
							.get("sReceiveEmail")));
					o.setsReceiveName(DataUtil.Stringg.getValueOrNull(m
							.get("sReceiveName")));
					o.setsReceivePhone(DataUtil.Stringg.getValueOrNull(m
							.get("sReceivePhone")));
					o.setsReceivePostcode(DataUtil.Stringg.getValueOrNull(m
							.get("sReceivePostcode")));
					o.setsReceiveProvince(DataUtil.Stringg.getValueOrNull(m
							.get("sReceiveProvince")));
					o.setsReceiveRegion(DataUtil.Stringg.getValueOrNull(m
							.get("sReceiveRegion")));
					o.setsSenderAddress(DataUtil.Stringg.getValueOrNull(m
							.get("sSenderAddress")));
					o.setsSenderName(DataUtil.Stringg.getValueOrNull(m
							.get("sSenderName")));
					o.setsSenderPhone(DataUtil.Stringg.getValueOrNull(m
							.get("sSenderPhone")));
					o.setsSmallTicket(DataUtil.Stringg.getValueOrNull(m
							.get("sSmallTicket")));
					o.setsTransferCenter(DataUtil.Stringg.getValueOrNull(m
							.get("sTransferCenter")));
					o.setsTransPortNo(DataUtil.Stringg.getValueOrNull(m
							.get("sTransPortNo")));
					Bills.add(o);
				}
			}
			if (sp.getTradingItem().size() > 0) {
				Ymt_TradingItem o = new Ymt_TradingItem();
				o.setiOrderId((int) sp.getTradingItem().get("iOrderId"));
				o.setiTradingId((int) sp.getTradingItem().get("iTradingId"));
				TradingItems.add(o);
			}
			if (DataUtil.isNullOrEmpty(sp.getOrderExts()) == false) {
				for (Map m : sp.getOrderExts()) {
					Ymt_OrderExt o = new Ymt_OrderExt();
					o.setiOrderId(DataUtil.Integerr.GetValueOrDefault(
							m.get("iOrderId"), 0));
					o.setiOrderType(DataUtil.Integerr.GetValueOrDefault(
							m.get("iOrderType"), 0));
					o.setsOrderSource(DataUtil.Stringg.getValueOrNull(m
							.get("sOrderSource")));
					o.setsOrderSourceIP(DataUtil.Stringg.getValueOrNull(m
							.get("sOrderSourceIP")));
					o.setsTerminalSource(DataUtil.Stringg.getValueOrNull(m
							.get("sTerminalSource")));
					o.setbIsNeedUploadIdCard(DataUtil.Booleann
							.GetValueOrDefault(m.get("bIsNeedUploadIdCard"),
									false));
					o.setbHaveUploadedIdCard(DataUtil.Booleann
							.GetValueOrDefault(m.get("bHaveUploadedIdCard"),
									false));
					o.setbNewSellerOrder(DataUtil.Booleann.GetValueOrDefault(
							m.get("bNewSellerOrder"), null));
					o.setbNewCustomerOrder(DataUtil.Booleann.GetValueOrDefault(
							m.get("bNewCustomerOrder"), null));
					o.setbIsFirstOrder(DataUtil.Booleann.GetValueOrDefault(m
							.get("bIsFirstOrder")));
					OrderExts.add(o);
				}
			}
		}
		entity.setCreditDetails(CreditDetails);
		entity.setOrderExts(OrderExts);
		entity.setOrderFrozens(OrderFrozens);
		entity.setOrderInfos(OrderInfos);
		entity.setOrderNotes(OrderNotes);
		entity.setOrders(Orders);
		entity.setOrderStates(OrderStates);
		entity.setOrderSummaries(OrderSummaries);
		entity.setOrderToBills(OrderToBills);
		entity.setPostPays(PostPays);
		entity.setTradingItems(TradingItems);
		entity.setBills(Bills);
		entity.setTotalCount(DataUtil.isNullOrEmpty(result.getOrders())
				? 0
				: result.getOrders().size());
		return entity;
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_001() {
		Logger.start(true, "获取单个订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o.create1_M2cOrder(userId, sellerId);
			Thread.sleep(2000);
			Logger.comment("完成准备订单数据");
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_002() {
		Logger.start(true, "用户id为空");
		try {
			// 创建订单
			/*
			 * Map map = new OrderCallService().createOrder(); JSONArray
			 * OrderIds = (JSONArray) map.get("OrderIds"); int OrderId =
			 * OrderIds.getInt(0); int UserId = (Integer) map.get("UserId");
			 */
			gsoibean.setOrderId(105293318);
			// gsoibean.setUserId(3793376);
			// 发送请求
			String param = FormatUtil.beanToHttpString(gsoibean, true, false);
			gsoicall.setData(param);
			gsoicall.callService();
			Logger.comment("gsoicall send:" + gsoicall.getEntityString());
			Logger.comment("gsoicall response:" + gsoicall.getReturnData());
			Logger.verifyEquals(ECode.ERROR400, gsoicall.getCode(), "验证Code");
			// Logger.verifyEquals(ErrorCode.SUCCESSMSG, gsoicall.getMsg(),
			// "验证Msg");
			/*
			 * Logger.verifyEquals(OrderId, gsoicall.getOrderId(), "验证OrderId");
			 * Logger.verifyEquals(UserId, gsoicall.getUserId(), "验证UserId");
			 */
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	@Ignore
	public void Tc_GetSingleOrderInfo_003() {
		Logger.start(true, "订单编号id为空");
		try {
			gsoibean.setUserId(3793376);
			// 发送请求
			String param = FormatUtil.beanToHttpString(gsoibean, true, false);
			gsoicall.setData(param);
			gsoicall.callService();
			Logger.comment("gsoicall send:" + gsoicall.getEntityString());
			Logger.comment("gsoicall response:" + gsoicall.getReturnData());
			Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_004() {
		Logger.start(true, "用户id不存在");
		try {
			gsoibean.setOrderId(105293318);
			gsoibean.setUserId(1);
			// 发送请求
			String param = FormatUtil.beanToHttpString(gsoibean, true, false);
			gsoicall.setData(param);
			gsoicall.callService();
			Logger.comment("gsoicall send:" + gsoicall.getEntityString());
			Logger.comment("gsoicall response:" + gsoicall.getReturnData());
			Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_005() {
		Logger.start(true, "获取确认收货状态的订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o.create4_ReceivedOrder(userId, sellerId);
			Logger.comment("完成准备订单数据");
			// Thread.sleep(5000l);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_006() {
		Logger.start(true, "获取申请退款状态的订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o
					.create4_ApplyRefundOrder(userId, sellerId);
			Logger.comment("完成准备订单数据");
			//			Thread.sleep(5000l);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_007() {
		Logger.start(true, "获取单个订单信息成功,BusynessTypeList=null");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o.create1_M2cOrder(userId, sellerId);
			Logger.comment("完成准备订单数据");
			//			Thread.sleep(2000l);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_008() {
		Logger.start(true, "获取完成退款状态的订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o.create4_RefundOrder(userId, sellerId);
			Logger.comment("完成准备订单数据");
			//Thread.sleep(5000);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_009() {
		Logger.start(true, "获取取消状态的订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o
					.create12_UserCancelOrder(userId, sellerId);
			Logger.comment("完成准备订单数据");
			// Thread.sleep(2000l);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_010() {
		Logger.start(true, "获取已付款状态的订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o.create2_PayOrder(userId, sellerId);
			Logger.comment("完成准备订单数据");
			//			Thread.sleep(5000l);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_011() {
		Logger.start(true, "获取发货状态的订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o.create3_ShippedOrder(userId, sellerId);
			Logger.comment("完成准备订单数据");
			// Thread.sleep(5000l);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_012() {
		Logger.start(true, "获取退款失败状态的订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o.create4_RefundFailedOrder(userId,
					sellerId);
			Logger.comment("完成准备订单数据");
			// Thread.sleep(5000l);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_013() {
		Logger.start(true, "获取参加满减优惠活动的订单信息成功");
		try {
			Logger.comment("准备订单数据");
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
			OrderCreate o = new OrderCreate();
			C2COrderInfoExt order = o.createOrderWithSellerCoupon(userId,
					sellerId);
			Logger.comment("完成准备订单数据");
			Thread.sleep(2000l);
			if (SyncVerifyService.getSyncResult(order.getiOrderId())) {
				gsoibean.setOrderId(order.getiOrderId());
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_014() {
		Logger.start(true, "带运费的订单申请退款及运费");
		try {
			Logger.comment("准备订单数据");
			PlaceOrderResp placeOrderResp = SettlementService
					.placeOrder2(false);

			Order order = placeOrderResp.getOrderList().get(0);

			int orderId = order.getOrderId();
			int userId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();
			int sellerId = order.getSellerId();
			BigDecimal payAmount = placeOrderResp.getPayAmount();

			OrderCallService orderCallService = new OrderCallService();

			// 支付订单
			orderCallService.orderPayRequest(userId, payAmount, tradingId);
			// 接单
			orderCallService.acceptOrder(orderId, sellerId);
			// 商家发货
			orderCallService.dispatched(orderId, sellerId);

			// 部分退款

			OrderInfoPo orderInfoPo1 = order.getOrderInfoList().get(0);
			OrderInfoPo orderInfoPo2 = order.getOrderInfoList().get(1);

			BigDecimal partRefund1 = SettlementService
					.calcRealPayAmountOnProduct(orderInfoPo1.getOrderInfoId())
					.add(BigDecimal.ONE);

			BigDecimal partRefund2 = SettlementService
					.calcRealPayAmountOnProduct(orderInfoPo2.getOrderInfoId())
					.add(BigDecimal.ONE);

			ApplySalesRefundRequestBean applySalesRefundRequestBean = orderCallService
					.applySalesRefundRequestInJavaBean(orderId);

			applySalesRefundRequestBean.getSalesRefundInfoList().remove(2);

			applySalesRefundRequestBean.getSalesRefundInfoList().get(0)
					.setRefundAmount(partRefund1);

			applySalesRefundRequestBean.getSalesRefundInfoList().get(1)
					.setRefundAmount(partRefund2);

			orderCallService
					.applySalesRefundRequestCall(applySalesRefundRequestBean);
			//退款执行
			orderCallService
					.salesrefundsuccessrequest(applySalesRefundRequestBean);
			Thread.sleep(2000);

			Logger.comment("完成准备订单数据");

			if (SyncVerifyService.getSyncResult(orderId)) {

				gsoibean.setOrderId(orderId);
				gsoibean.setUserId(sellerId);
				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();
				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSingleOrderInfo_015() {
		Logger.start(true, "订单含有组合商品");
		try {

			Logger.comment("准备订单数据");

			PlaceOrderResp placeOrderResp = PlaceOrderService.placeOrder10();

			Order order = placeOrderResp.getOrderList().get(0);

			int orderId = order.getOrderId();

			int sellerId = order.getSellerId();

			Logger.comment("完成准备订单数据");

			if (SyncVerifyService.getSyncResult(orderId)) {

				gsoibean.setOrderId(orderId);
				gsoibean.setUserId(sellerId);

				// 发送请求
				String param = FormatUtil.beanToHttpString(gsoibean, true,
						false);
				gsoicall.setData(param);
				gsoicall.callService();

				Logger.comment("gsoicall send:" + gsoicall.getEntityString());
				Logger.comment("gsoicall response:" + gsoicall.getReturnData());
				Logger.verifyEquals(ECode.SUCCESS, gsoicall.getCode(), "验证Code");
				verify();
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

}